<template>
  <header class="home-header">
    <h1>数据可视化</h1>
    <p class="showTime">当前时间：{{ time }}</p>
  </header>
</template>

<script lang="ts" setup>
import { timeCn } from "just-now-time"
import { onMounted, ref } from "vue"
let time = ref("")
onMounted(() => {
  time.value = timeCn().full
  setInterval(() => {
    time.value = timeCn().full
  }, 1000)
})
</script>

<style lang="less" scoped>
.home-header {
  height: 60px;
  color: #fff;
  background: url("../assets/images/head_bg.png") no-repeat;
  background-size: 100% 100%;
  h1 {
    font-size: 24px;
    line-height: 50px;
    text-align: center;
  }
  .showTime {
    position: absolute;
    top: 0;
    right: 20px;
    line-height: 45px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
  }
}
</style>
